(function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.Popper=t()})(this,function(){"use strict";function ft(n){return n&&"[object Function]"==={}.toString.call(n)}function r(n,t){if(1!==n.nodeType)return[];var r=n.ownerDocument.defaultView,i=r.getComputedStyle(n,null);return t?i[t]:i}function y(n){return"HTML"===n.nodeName?n:n.parentNode||n.host}function s(n){if(!n)return document.body;switch(n.nodeName){case"HTML":case"BODY":return n.ownerDocument.body;case"#document":return n.body}var t=r(n),i=t.overflow,u=t.overflowX,f=t.overflowY;return/(auto|scroll|overlay)/.test(i+f+u)?n:s(y(n))}function u(n){return 11===n?ui:10===n?fi:ui||fi}function f(n){var e,t,i;if(!n)return document.documentElement;for(e=u(10)?document.body:null,t=n.offsetParent||null;t===e&&n.nextElementSibling;)t=(n=n.nextElementSibling).offsetParent;return i=t&&t.nodeName,i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(t.nodeName)&&"static"===r(t,"position")?f(t):t:n?n.ownerDocument.documentElement:document.documentElement}function oi(n){var t=n.nodeName;return"BODY"!==t&&("HTML"===t||f(n.firstElementChild)===n)}function p(n){return null===n.parentNode?n:p(n.parentNode)}function l(n,t){var i,u;if(!n||!n.nodeType||!t||!t.nodeType)return document.documentElement;var e=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=e?n:t,s=e?t:n,r=document.createRange();return(r.setStart(o,0),r.setEnd(s,0),i=r.commonAncestorContainer,n!==i&&t!==i||o.contains(s))?oi(i)?i:f(i):(u=p(n),u.host?l(u.host,t):l(n,p(t).host))}function e(n){var f=1=r.clientWidth&&i>=r.clientHeight}),a=0s[n]&&!r.escapeWithReference&&(i=ni(u[t],s[n]-("right"===n?u.width:u.height))),o({},t,i)}};return y.forEach(function(t){var i=-1===["left","top"].indexOf(t)?"secondary":"primary";u=n({},u,p[i](t))}),i.offsets.popper=u,i},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(n){var o=n.offsets,u=o.popper,i=o.reference,s=n.placement.split("-")[0],r=tt,f=-1!==["top","bottom"].indexOf(s),e=f?"right":"bottom",t=f?"left":"top",h=f?"width":"height";return u[e]r(i[e])&&(n.offsets.popper[t]=r(i[e])),n}},arrow:{order:500,enabled:!0,fn:function(n,u){var l,e;if(!dt(n.instance.modifiers,"arrow","keepTogether"))return n;if(e=u.element,"string"==typeof e){if(e=n.instance.popper.querySelector(e),!e)return n}else if(!n.instance.popper.contains(e))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),n;var d=n.placement.split("-")[0],b=n.offsets,c=b.popper,s=b.reference,a=-1!==["left","right"].indexOf(d),y=a?"height":"width",p=a?"Top":"Left",f=p.toLowerCase(),g=a?"left":"top",v=a?"bottom":"right",h=vt(e)[y];s[v]-hc[v]&&(n.offsets.popper[f]+=s[f]+h-c[v]);n.offsets.popper=i(n.offsets.popper);var nt=s[f]+s[y]/2-h/2,k=r(n.instance.popper),tt=parseFloat(k["margin"+p],10),it=parseFloat(k["border"+p+"Width"],10),w=nt-n.offsets.popper[f]-tt-it;return w=t(ni(c[y]-h,w),0),n.arrowElement=e,n.offsets.arrow=(l={},o(l,f,ti(w)),o(l,g,""),l),n},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,i){if(wt(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var e=k(t.instance.popper,t.instance.reference,i.padding,i.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],o=a(r),u=t.placement.split("-")[1]||"",f=[];switch(i.behavior){case ut.FLIP:f=[r,o];break;case ut.CLOCKWISE:f=gt(r);break;case ut.COUNTERCLOCKWISE:f=gt(r,!0);break;default:f=i.behavior}return f.forEach(function(s,h){if(r!==s||f.length===h+1)return t;r=t.placement.split("-")[0];o=a(r);var l=t.offsets.popper,v=t.offsets.reference,c=tt,p="left"===r&&c(l.right)>c(v.left)||"right"===r&&c(l.left)c(v.top)||"bottom"===r&&c(l.top)c(e.right),k=c(l.top)c(e.bottom),g="left"===r&&w||"right"===r&&b||"top"===r&&k||"bottom"===r&&d,y=-1!==["top","bottom"].indexOf(r),nt=!!i.flipVariations&&(y&&"start"===u&&w||y&&"end"===u&&b||!y&&"start"===u&&k||!y&&"end"===u&&d);(p||g||nt)&&(t.flipped=!0,(p||g)&&(r=f[h+1]),nt&&(u=gi(u)),t.placement=r+(u?"-"+u:""),t.offsets.popper=n({},t.offsets.popper,yt(t.instance.popper,t.offsets.reference,t.placement)),t=pt(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(n){var u=n.placement,t=u.split("-")[0],f=n.offsets,r=f.popper,o=f.reference,e=-1!==["left","right"].indexOf(t),s=-1===["top","left"].indexOf(t);return r[e?"left":"top"]=o[t]-(s?r[e?"width":"height"]:0),n.placement=a(u),n.offsets.popper=i(r),n}},hide:{order:800,enabled:!0,fn:function(n){if(!dt(n.instance.modifiers,"hide","preventOverflow"))return n;var t=n.offsets.reference,i=h(n.instance.modifiers,function(n){return"preventOverflow"===n.name}).boundaries;if(t.bottomi.right||t.top>i.bottom||t.rightwindow.devicePixelRatio||!or),o="bottom"===g?"top":"bottom",s="right"===nt?"left":"right",y=d("transform");return(a="bottom"==o?"HTML"===e.nodeName?-e.clientHeight+u.bottom:-v.height+u.bottom:u.top,l="right"==s?"HTML"===e.nodeName?-e.clientWidth+u.right:-v.width+u.right:u.left,it&&y)?(r[y]="translate3d("+l+"px, "+a+"px, 0)",r[o]=0,r[s]=0,r.willChange="transform"):(p="bottom"==o?-1:1,b="right"==s?-1:1,r[o]=a*p,r[s]=l*b,r.willChange=o+", "+s),k={"x-placement":t.placement},t.attributes=n({},k,t.attributes),t.styles=n({},r,t.styles),t.arrowStyles=n({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(n){return nt(n.instance.popper,n.styles),ki(n.instance.popper,n.attributes),n.arrowElement&&Object.keys(n.arrowStyles).length&&nt(n.arrowElement,n.arrowStyles),n},onLoad:function(n,t,i,r,u){var f=at(u,t,n,i.positionFixed),e=lt(i.placement,f,t,n,i.modifiers.flip.boundariesElement,i.modifiers.flip.padding);return t.setAttribute("x-placement",e),nt(t,{position:i.positionFixed?"fixed":"absolute"}),i},gpuAcceleration:void 0}}},v})